# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models


class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding model 'Address'
        db.create_table(u'common_address', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('street', self.gf('django.db.models.fields.CharField')(max_length=200)),
            ('postal_code', self.gf('django.db.models.fields.CharField')(max_length=5)),
            ('city', self.gf('django.db.models.fields.CharField')(max_length=60)),
            ('country', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['countries_states.Country'])),
            ('state', self.gf('django.db.models.fields.related.ForeignKey')(default='0', to=orm['countries_states.State'], null=True, on_delete=models.SET('0'))),
            ('municipal', self.gf('django.db.models.fields.related.ForeignKey')(default='0', to=orm['countries_states.Municipal'], null=True, on_delete=models.SET('0'))),
            ('last_modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
        ))
        db.send_create_signal(u'common', ['Address'])


    def backwards(self, orm):
        # Deleting model 'Address'
        db.delete_table(u'common_address')


    models = {
        u'common.address': {
            'Meta': {'object_name': 'Address'},
            'city': ('django.db.models.fields.CharField', [], {'max_length': '60'}),
            'country': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['countries_states.Country']"}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'municipal': ('django.db.models.fields.related.ForeignKey', [], {'default': "'0'", 'to': u"orm['countries_states.Municipal']", 'null': 'True', 'on_delete': "models.SET('0')"}),
            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '5'}),
            'state': ('django.db.models.fields.related.ForeignKey', [], {'default': "'0'", 'to': u"orm['countries_states.State']", 'null': 'True', 'on_delete': "models.SET('0')"}),
            'street': ('django.db.models.fields.CharField', [], {'max_length': '200'})
        },
        u'countries_states.country': {
            'Meta': {'ordering': "('name',)", 'object_name': 'Country'},
            'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'continent': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'iso2_code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '2'}),
            'iso3_code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'numcode': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'printable_name': ('django.db.models.fields.CharField', [], {'max_length': '128'})
        },
        u'countries_states.municipal': {
            'Meta': {'ordering': "('name',)", 'object_name': 'Municipal'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
            'state': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['countries_states.State']", 'null': 'True', 'blank': 'True'})
        },
        u'countries_states.state': {
            'Meta': {'ordering': "('name',)", 'object_name': 'State'},
            'abbr': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'blank': 'True'}),
            'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'country': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['countries_states.Country']", 'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '60'})
        }
    }

    complete_apps = ['common']